#ifndef RSIM_DCADATA3D_H
#define RSIM_DCADATA3D_H

/*-------------------------------------------------------------------------- *
* File: DCAData3D.h                                                          *
* Authors: Kishor Bhalerao                                                   *
* Email : kishor8dm@gmail.com                                                *
* Contributors:                                                              *
* Email:                                                                     *
* copyright (c) 2010 Authors.                                                *
*                                                                            *
* This program is free software: you can redistribute it and/or modify it    *
* under the terms of the GNU General Public License as published by the Free *
* Software Foundation, either version 3 of the License, or any later version.*
*                                                                            *
* This program is distributed in the hope that it will be useful, but        *
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
* or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   *
* for more details. (http://www.gnu.org/licenses/)                           *
* -------------------------------------------------------------------------- */

#include "MatrixClasses.h"

namespace RSIM{
        
class DCAData3D{
        public:                
                DCAData3D(){}
                // Handle 1
                Mat6x6 phi11_;
                Mat6x6 phi12_;
                Vect6 phi13_;
                
                // Handle 2
                Mat6x6 phi21_;
                Mat6x6 phi22_;
                Vect6 phi23_;
                
                void copyH1(const DCAData3D&);
                void copyH2(const DCAData3D&);
                
                void displayH1()const;
                void displayH2()const;
        private:                                
                DCAData3D(const DCAData3D&);
                                
}; // class DCAData2D

inline void DCAData3D::displayH1()const{
        cout<<phi11_<<endl<<endl;
        cout<<phi12_<<endl<<endl;
        cout<<phi13_<<endl<<endl;
}

inline void DCAData3D::displayH2()const{
        cout<<phi21_<<endl<<endl;
        cout<<phi22_<<endl<<endl;
        cout<<phi23_<<endl<<endl;
}

inline void DCAData3D::copyH1(const DCAData3D& D){
        const double *dphi11 = D.phi11_.Ptr();
        const double *dphi12 = D.phi12_.Ptr();
        const double *dphi13 = D.phi13_.Ptr();
        
        double *phi11 = phi11_.wPtr();
        double *phi12 = phi12_.wPtr();
        double *phi13 = phi13_.wPtr();
        
        for(int i=0;i<36;++i){
                phi11[i] = dphi11[i];
                phi12[i] = dphi12[i];
        }
        phi13[0] = dphi13[0];
        phi13[1] = dphi13[1];
        phi13[2] = dphi13[2];
        phi13[3] = dphi13[3];
        phi13[4] = dphi13[4];
        phi13[5] = dphi13[5];
}

inline void DCAData3D::copyH2(const DCAData3D& D){
        const double *dphi21 = D.phi21_.Ptr();
        const double *dphi22 = D.phi22_.Ptr();
        const double *dphi23 = D.phi23_.Ptr();
        
        double *phi21 = phi21_.wPtr();
        double *phi22 = phi22_.wPtr();
        double *phi23 = phi23_.wPtr();
        
        for(int i=0;i<36;++i){
                phi21[i] = dphi21[i];
                phi22[i] = dphi22[i];
        }
        phi23[0] = dphi23[0];
        phi23[1] = dphi23[1];
        phi23[2] = dphi23[2];
        phi23[3] = dphi23[3];
        phi23[4] = dphi23[4];
        phi23[5] = dphi23[5];
}

} // namespace RSIM

#endif